#ifndef _LISTNODE_H_
#define _LISTNODE_H_

#include <vector>
#include <string>

using namespace std;

#include "HeteroAST.h"

class ListNode : public HeteroAST {
protected:
    vector<HeteroAST*> elements;
public:
    ListNode(vector<HeteroAST*> elements) {
        this->elements = elements;
    }
    string to_string_tree() {
        if (elements.size() == 0)
            return this->to_string();
        string buf;
        for (int i = 0; i < elements.size(); i++) {
            HeteroAST *t = elements[i];
            if (i > 0)
                buf.push_back(' ');
            buf += t->to_string_tree();
        }
        return buf;
    }
};

#endif
